package com.cskaoyan.dbutils.handler;

import com.cskaoyan.connectionpool.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ColumnListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;
import java.util.List;

/**
 * 创建日期: 2022/03/24 14:49
 *
 * @author ciggar
 */
public class ScalarHandlerDemo {

    public static void main(String[] args) throws SQLException {

        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Integer maxMoney = queryRunner.query("select max(money) from account", new ScalarHandler<>());

        System.out.println("maxMoney:" + maxMoney);

    }

}
